﻿Partial Class Utilerias_CatGeneral
    Inherits System.Web.UI.Page

    Protected Sub Nuevo_ItemInserted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewInsertedEventArgs) Handles Nuevo.ItemInserted

        ' Controlamos la excepcion y enviamos un mensaje personalizado
        If e.Exception IsNot Nothing Then
            lblExcepcion.CssClass = "error"
            lblExcepcion.Text = "Ya existe el registro"
            e.ExceptionHandled = True
            e.KeepInInsertMode = True
        Else
            lblExcepcion.CssClass = "success"
            lblExcepcion.Text = "Registro ingresado"
            ddlCategoria.SelectedValue = e.Values(0).ToString
            gvCatGral.DataBind()

        End If

    End Sub



    Protected Sub Utilerias_CatGeneral_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        lblExcepcion.Text = ""
        lblExcepcion.CssClass = ""
    End Sub
End Class
